{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from machine_lib import * "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n"
     ]
    }
   ],
   "source": [
    "s = login()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                        id  \\\n",
      "0               fnd65_allcap_sedol_52whigh   \n",
      "1              fnd65_allcap_sedol_60dsigma   \n",
      "2               fnd65_allcap_sedol_6351_rp   \n",
      "3             fnd65_allcap_sedol_actrtn12m   \n",
      "4             fnd65_allcap_sedol_actrtn18m   \n",
      "..                                     ...   \n",
      "982      fnd65_northamerica_sedol_yoychgda   \n",
      "983     fnd65_northamerica_sedol_yoychggpm   \n",
      "984     fnd65_northamerica_sedol_yoychgroa   \n",
      "985  fnd65_northamerica_sedol_yoychgroeart   \n",
      "986  fnd65_northamerica_sedol_yoychgroepct   \n",
      "\n",
      "                                           description  \\\n",
      "0    It is defined as the month-end price divided b...   \n",
      "1    Sigma is defined as the standard deviation of ...   \n",
      "2    It is defined as the moving average of a stock...   \n",
      "3    It is defined as the percent change in price f...   \n",
      "4    It is defined as the percent change in price f...   \n",
      "..                                                 ...   \n",
      "982  It is defined as the difference between the mo...   \n",
      "983  It is defined as the most recent quarterly rep...   \n",
      "984  It is defined as the most recent trailing 12-m...   \n",
      "985  It is defined as the yearly arithmetic change ...   \n",
      "986  It is defined as the yearly percentage change ...   \n",
      "\n",
      "                                               dataset  \\\n",
      "0    {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "1    {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "2    {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "3    {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "4    {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "..                                                 ...   \n",
      "982  {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "983  {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "984  {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "985  {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "986  {'id': 'fundamental65', 'name': 'Factor Ratios...   \n",
      "\n",
      "                             category  \\\n",
      "0    {'id': 'model', 'name': 'Model'}   \n",
      "1    {'id': 'model', 'name': 'Model'}   \n",
      "2    {'id': 'model', 'name': 'Model'}   \n",
      "3    {'id': 'model', 'name': 'Model'}   \n",
      "4    {'id': 'model', 'name': 'Model'}   \n",
      "..                                ...   \n",
      "982  {'id': 'model', 'name': 'Model'}   \n",
      "983  {'id': 'model', 'name': 'Model'}   \n",
      "984  {'id': 'model', 'name': 'Model'}   \n",
      "985  {'id': 'model', 'name': 'Model'}   \n",
      "986  {'id': 'model', 'name': 'Model'}   \n",
      "\n",
      "                                           subcategory region  delay universe  \\\n",
      "0    {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "1    {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "2    {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "3    {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "4    {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "..                                                 ...    ...    ...      ...   \n",
      "982  {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "983  {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "984  {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "985  {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "986  {'id': 'model-estimates-models', 'name': 'Esti...    AMR      1   TOP600   \n",
      "\n",
      "       type  coverage  userCount  alphaCount  pyramidMultiplier themes  \n",
      "0    MATRIX    0.8985          6          24                1.8     []  \n",
      "1    MATRIX    0.8933          3           4                1.8     []  \n",
      "2    MATRIX    0.8583          0           0                1.8     []  \n",
      "3    MATRIX    0.8471          2           3                1.8     []  \n",
      "4    MATRIX    0.8287          0           0                1.8     []  \n",
      "..      ...       ...        ...         ...                ...    ...  \n",
      "982  MATRIX    0.4163          0           0                1.8     []  \n",
      "983  MATRIX    0.3380          0           0                1.8     []  \n",
      "984  MATRIX    0.4146          0           0                1.8     []  \n",
      "985  MATRIX    0.4077          0           0                1.8     []  \n",
      "986  MATRIX    0.3835          0           0                1.8     []  \n",
      "\n",
      "[987 rows x 14 columns]\n"
     ]
    }
   ],
   "source": [
    "df = get_datafields(s, dataset_id = 'fundamental65', region='AMR', universe='TOP600')\n",
    "print(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4)', 'winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4)', 'winsorize(ts_backfill(fnd65_allcap_sedol_6351_rp, 120), std=4)']\n"
     ]
    }
   ],
   "source": [
    "# selected_datafields_df = df[\n",
    "#     (df[\"userCount\"] > 0)\n",
    "#     ].sort_values(by=[\"userCount\"], ascending=False)\n",
    "# print(selected_datafields_df)\n",
    "\n",
    "pc_fields = process_datafields(df, \"matrix\")\n",
    "print(pc_fields[:3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4)', 'ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 'ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 'ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 'ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 'ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 'ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 'ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 'ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 'ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)']\n",
      "84882\n"
     ]
    }
   ],
   "source": [
    "first_order = first_order_factory(pc_fields, ts_ops)\n",
    "print(first_order[:10])\n",
    "print(len(first_order))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "84882\n",
      "[('winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)]\n"
     ]
    }
   ],
   "source": [
    "# Pad initial decay with alpha\n",
    "init_decay = 4\n",
    "fo_alpha_list = []\n",
    "for alpha in first_order:\n",
    "    fo_alpha_list.append((alpha, init_decay))\n",
    "print(len(fo_alpha_list))\n",
    "print(fo_alpha_list[:5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[('winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_sum(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_sum(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_sum(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_sum(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_sum(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_product(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_product(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_product(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_product(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_product(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_ir(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_ir(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_ir(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_ir(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_ir(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_std_dev(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_std_dev(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_std_dev(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_std_dev(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_std_dev(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_mean(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_mean(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_mean(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_mean(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_mean(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_arg_min(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_arg_min(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_arg_min(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_arg_min(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_arg_min(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_arg_max(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_arg_max(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_arg_max(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_arg_max(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_arg_max(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_min_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_min_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_min_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_min_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_min_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_max_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_max_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_max_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_max_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_max_diff(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_returns(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_returns(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_returns(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_returns(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_returns(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_scale(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_scale(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_scale(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_scale(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_scale(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_skewness(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_skewness(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_skewness(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_skewness(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_skewness(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_kurtosis(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_kurtosis(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_kurtosis(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_kurtosis(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4)], [('ts_kurtosis(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('ts_quantile(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 5)', 4), ('ts_quantile(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 22)', 4), ('ts_quantile(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 66)', 4), ('ts_quantile(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 120)', 4), ('ts_quantile(winsorize(ts_backfill(fnd65_allcap_sedol_52whigh, 120), std=4), 240)', 4), ('winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 5)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 22)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 66)', 4)], [('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 120)', 4), ('ts_rank(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 240)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 5)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 22)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 66)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 120)', 4), ('ts_zscore(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 240)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 5)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 22)', 4), ('ts_delta(winsorize(ts_backfill(fnd65_allcap_sedol_60dsigma, 120), std=4), 66)', 4)]]\n",
      "849\n"
     ]
    }
   ],
   "source": [
    "# Load alphas to task pools\n",
    "pools = load_task_pool(fo_alpha_list, 10, 10)\n",
    "print(pools[0])\n",
    "print(len(pools))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "pool 123 task 9 post done\n",
      "pool 123 task 0 simulate done\n",
      "pool 123 task 1 simulate done\n",
      "pool 123 task 2 simulate done\n",
      "pool 123 task 3 simulate done\n",
      "pool 123 task 4 simulate done\n",
      "pool 123 task 5 simulate done\n",
      "pool 123 task 6 simulate done\n",
      "pool 123 task 7 simulate done\n",
      "pool 123 task 8 simulate done\n",
      "pool 124 task 9 post done\n",
      "pool 124 task 0 simulate done\n",
      "pool 124 task 1 simulate done\n",
      "pool 124 task 2 simulate done\n",
      "pool 124 task 3 simulate done\n",
      "pool 124 task 4 simulate done\n",
      "pool 124 task 5 simulate done\n",
      "pool 124 task 6 simulate done\n",
      "pool 124 task 7 simulate done\n",
      "pool 124 task 8 simulate done\n",
      "pool 124 task 9 simulate done\n",
      "pool 125 task 9 post done\n",
      "pool 125 task 0 simulate done\n",
      "pool 125 task 1 simulate done\n",
      "pool 125 task 2 simulate done\n",
      "pool 125 task 3 simulate done\n",
      "pool 125 task 4 simulate done\n",
      "pool 125 task 5 simulate done\n",
      "pool 125 task 6 simulate done\n",
      "pool 125 task 7 simulate done\n",
      "pool 125 task 8 simulate done\n",
      "pool 125 task 9 simulate done\n",
      "pool 126 task 9 post done\n",
      "pool 126 task 0 simulate done\n",
      "pool 126 task 1 simulate done\n",
      "pool 126 task 2 simulate done\n",
      "pool 126 task 3 simulate done\n",
      "pool 126 task 4 simulate done\n",
      "pool 126 task 5 simulate done\n",
      "pool 126 task 6 simulate done\n",
      "pool 126 task 7 simulate done\n",
      "pool 126 task 8 simulate done\n",
      "pool 126 task 9 simulate done\n",
      "pool 127 task 9 post done\n",
      "pool 127 task 0 simulate done\n",
      "pool 127 task 1 simulate done\n",
      "pool 127 task 2 simulate done\n",
      "pool 127 task 3 simulate done\n",
      "pool 127 task 4 simulate done\n",
      "pool 127 task 5 simulate done\n",
      "pool 127 task 6 simulate done\n",
      "pool 127 task 7 simulate done\n",
      "pool 127 task 8 simulate done\n",
      "pool 127 task 9 simulate done\n",
      "pool 128 task 9 post done\n",
      "pool 128 task 0 simulate done\n",
      "pool 128 task 1 simulate done\n",
      "pool 128 task 2 simulate done\n",
      "pool 128 task 3 simulate done\n",
      "pool 128 task 4 simulate done\n",
      "pool 128 task 5 simulate done\n",
      "pool 128 task 6 simulate done\n",
      "pool 128 task 7 simulate done\n",
      "pool 128 task 8 simulate done\n",
      "pool 128 task 9 simulate done\n",
      "pool 129 task 9 post done\n",
      "pool 129 task 0 simulate done\n",
      "pool 129 task 1 simulate done\n",
      "pool 129 task 2 simulate done\n",
      "pool 129 task 3 simulate done\n",
      "pool 129 task 4 simulate done\n",
      "pool 129 task 5 simulate done\n",
      "pool 129 task 6 simulate done\n",
      "pool 129 task 7 simulate done\n",
      "pool 129 task 8 simulate done\n",
      "pool 129 task 9 simulate done\n",
      "pool 130 task 9 post done\n",
      "pool 130 task 0 simulate done\n",
      "pool 130 task 1 simulate done\n",
      "pool 130 task 2 simulate done\n",
      "pool 130 task 3 simulate done\n",
      "pool 130 task 4 simulate done\n",
      "pool 130 task 5 simulate done\n",
      "pool 130 task 6 simulate done\n",
      "pool 130 task 7 simulate done\n",
      "pool 130 task 8 simulate done\n",
      "pool 130 task 9 simulate done\n",
      "pool 131 task 9 post done\n",
      "pool 131 task 0 simulate done\n",
      "pool 131 task 1 simulate done\n",
      "pool 131 task 2 simulate done\n",
      "pool 131 task 3 simulate done\n",
      "pool 131 task 4 simulate done\n",
      "pool 131 task 5 simulate done\n",
      "pool 131 task 6 simulate done\n",
      "pool 131 task 7 simulate done\n",
      "pool 131 task 8 simulate done\n",
      "pool 131 task 9 simulate done\n",
      "pool 132 task 9 post done\n",
      "pool 132 task 0 simulate done\n",
      "pool 132 task 1 simulate done\n",
      "pool 132 task 2 simulate done\n",
      "pool 132 task 3 simulate done\n",
      "pool 132 task 4 simulate done\n",
      "pool 132 task 5 simulate done\n",
      "pool 132 task 6 simulate done\n",
      "pool 132 task 7 simulate done\n",
      "pool 132 task 8 simulate done\n",
      "pool 132 task 9 simulate done\n",
      "pool 133 task 9 post done\n",
      "pool 133 task 0 simulate done\n",
      "pool 133 task 1 simulate done\n",
      "pool 133 task 2 simulate done\n",
      "pool 133 task 3 simulate done\n",
      "pool 133 task 4 simulate done\n",
      "pool 133 task 5 simulate done\n",
      "pool 133 task 6 simulate done\n",
      "pool 133 task 7 simulate done\n",
      "pool 133 task 8 simulate done\n",
      "pool 133 task 9 simulate done\n",
      "pool 134 task 9 post done\n",
      "pool 134 task 0 simulate done\n",
      "pool 134 task 1 simulate done\n",
      "pool 134 task 2 simulate done\n",
      "pool 134 task 3 simulate done\n",
      "pool 134 task 4 simulate done\n",
      "pool 134 task 5 simulate done\n",
      "pool 134 task 6 simulate done\n",
      "pool 134 task 7 simulate done\n",
      "pool 134 task 8 simulate done\n",
      "pool 134 task 9 simulate done\n",
      "pool 135 task 9 post done\n",
      "pool 135 task 0 simulate done\n",
      "pool 135 task 1 simulate done\n",
      "pool 135 task 2 simulate done\n",
      "pool 135 task 3 simulate done\n",
      "pool 135 task 4 simulate done\n",
      "pool 135 task 5 simulate done\n",
      "pool 135 task 6 simulate done\n",
      "pool 135 task 7 simulate done\n",
      "pool 135 task 8 simulate done\n",
      "pool 135 task 9 simulate done\n",
      "pool 136 task 9 post done\n",
      "pool 136 task 0 simulate done\n",
      "pool 136 task 1 simulate done\n",
      "pool 136 task 2 simulate done\n",
      "pool 136 task 3 simulate done\n",
      "pool 136 task 4 simulate done\n",
      "pool 136 task 5 simulate done\n",
      "pool 136 task 6 simulate done\n",
      "pool 136 task 7 simulate done\n",
      "pool 136 task 8 simulate done\n",
      "pool 136 task 9 simulate done\n",
      "pool 137 task 9 post done\n",
      "pool 137 task 0 simulate done\n",
      "pool 137 task 1 simulate done\n",
      "pool 137 task 2 simulate done\n",
      "pool 137 task 3 simulate done\n",
      "pool 137 task 4 simulate done\n",
      "pool 137 task 5 simulate done\n",
      "pool 137 task 6 simulate done\n",
      "pool 137 task 7 simulate done\n",
      "pool 137 task 8 simulate done\n",
      "pool 137 task 9 simulate done\n",
      "pool 138 task 9 post done\n",
      "pool 138 task 0 simulate done\n",
      "pool 138 task 1 simulate done\n",
      "pool 138 task 2 simulate done\n",
      "pool 138 task 3 simulate done\n",
      "pool 138 task 4 simulate done\n",
      "pool 138 task 5 simulate done\n",
      "pool 138 task 6 simulate done\n",
      "pool 138 task 7 simulate done\n",
      "pool 138 task 8 simulate done\n",
      "pool 138 task 9 simulate done\n",
      "pool 139 task 9 post done\n",
      "pool 139 task 0 simulate done\n",
      "pool 139 task 1 simulate done\n",
      "pool 139 task 2 simulate done\n",
      "pool 139 task 3 simulate done\n",
      "pool 139 task 4 simulate done\n",
      "pool 139 task 5 simulate done\n",
      "pool 139 task 6 simulate done\n",
      "pool 139 task 7 simulate done\n",
      "pool 139 task 8 simulate done\n",
      "pool 139 task 9 simulate done\n",
      "pool 140 task 9 post done\n",
      "pool 140 task 0 simulate done\n",
      "pool 140 task 1 simulate done\n",
      "pool 140 task 2 simulate done\n",
      "pool 140 task 3 simulate done\n",
      "pool 140 task 4 simulate done\n",
      "pool 140 task 5 simulate done\n",
      "pool 140 task 6 simulate done\n",
      "pool 140 task 7 simulate done\n",
      "pool 140 task 8 simulate done\n",
      "pool 140 task 9 simulate done\n",
      "pool 141 task 9 post done\n",
      "pool 141 task 0 simulate done\n",
      "pool 141 task 1 simulate done\n",
      "pool 141 task 2 simulate done\n",
      "pool 141 task 3 simulate done\n",
      "pool 141 task 4 simulate done\n",
      "pool 141 task 5 simulate done\n",
      "pool 141 task 6 simulate done\n",
      "pool 141 task 7 simulate done\n",
      "pool 141 task 8 simulate done\n",
      "pool 141 task 9 simulate done\n",
      "pool 142 task 9 post done\n",
      "pool 142 task 0 simulate done\n",
      "pool 142 task 1 simulate done\n",
      "pool 142 task 2 simulate done\n",
      "pool 142 task 3 simulate done\n",
      "pool 142 task 4 simulate done\n",
      "pool 142 task 5 simulate done\n",
      "pool 142 task 6 simulate done\n",
      "pool 142 task 7 simulate done\n",
      "pool 142 task 8 simulate done\n",
      "pool 142 task 9 simulate done\n",
      "pool 143 task 9 post done\n",
      "pool 143 task 0 simulate done\n",
      "pool 143 task 1 simulate done\n",
      "pool 143 task 2 simulate done\n",
      "pool 143 task 3 simulate done\n",
      "pool 143 task 4 simulate done\n",
      "pool 143 task 5 simulate done\n",
      "pool 143 task 6 simulate done\n",
      "pool 143 task 7 simulate done\n",
      "pool 143 task 8 simulate done\n",
      "pool 143 task 9 simulate done\n",
      "pool 144 task 9 post done\n",
      "pool 144 task 0 simulate done\n",
      "pool 144 task 1 simulate done\n",
      "pool 144 task 2 simulate done\n",
      "pool 144 task 3 simulate done\n",
      "pool 144 task 4 simulate done\n",
      "pool 144 task 5 simulate done\n",
      "pool 144 task 6 simulate done\n",
      "pool 144 task 7 simulate done\n",
      "pool 144 task 8 simulate done\n",
      "pool 144 task 9 simulate done\n",
      "pool 145 task 9 post done\n",
      "pool 145 task 0 simulate done\n",
      "pool 145 task 1 simulate done\n",
      "pool 145 task 2 simulate done\n",
      "pool 145 task 3 simulate done\n",
      "pool 145 task 4 simulate done\n",
      "pool 145 task 5 simulate done\n",
      "pool 145 task 6 simulate done\n",
      "pool 145 task 7 simulate done\n",
      "pool 145 task 8 simulate done\n",
      "pool 145 task 9 simulate done\n",
      "pool 146 task 9 post done\n",
      "pool 146 task 0 simulate done\n",
      "pool 146 task 1 simulate done\n",
      "pool 146 task 2 simulate done\n",
      "pool 146 task 3 simulate done\n",
      "pool 146 task 4 simulate done\n",
      "pool 146 task 5 simulate done\n",
      "pool 146 task 6 simulate done\n",
      "pool 146 task 7 simulate done\n",
      "pool 146 task 8 simulate done\n",
      "pool 146 task 9 simulate done\n",
      "pool 147 task 9 post done\n",
      "pool 147 task 0 simulate done\n",
      "pool 147 task 1 simulate done\n",
      "pool 147 task 2 simulate done\n",
      "pool 147 task 3 simulate done\n",
      "pool 147 task 4 simulate done\n",
      "pool 147 task 5 simulate done\n",
      "pool 147 task 6 simulate done\n",
      "pool 147 task 7 simulate done\n",
      "pool 147 task 8 simulate done\n",
      "pool 147 task 9 simulate done\n",
      "pool 148 task 9 post done\n",
      "pool 148 task 0 simulate done\n",
      "pool 148 task 1 simulate done\n",
      "pool 148 task 2 simulate done\n",
      "pool 148 task 3 simulate done\n",
      "pool 148 task 4 simulate done\n",
      "pool 148 task 5 simulate done\n",
      "pool 148 task 6 simulate done\n",
      "pool 148 task 7 simulate done\n",
      "pool 148 task 8 simulate done\n",
      "pool 148 task 9 simulate done\n",
      "pool 149 task 9 post done\n",
      "pool 149 task 0 simulate done\n",
      "pool 149 task 1 simulate done\n",
      "pool 149 task 2 simulate done\n",
      "pool 149 task 3 simulate done\n",
      "pool 149 task 4 simulate done\n",
      "pool 149 task 5 simulate done\n",
      "pool 149 task 6 simulate done\n",
      "pool 149 task 7 simulate done\n",
      "pool 149 task 8 simulate done\n",
      "pool 149 task 9 simulate done\n",
      "pool 150 task 9 post done\n",
      "pool 150 task 0 simulate done\n",
      "pool 150 task 1 simulate done\n",
      "pool 150 task 2 simulate done\n",
      "pool 150 task 3 simulate done\n",
      "pool 150 task 4 simulate done\n",
      "pool 150 task 5 simulate done\n",
      "pool 150 task 6 simulate done\n",
      "pool 150 task 7 simulate done\n",
      "pool 150 task 8 simulate done\n",
      "pool 150 task 9 simulate done\n",
      "pool 151 task 9 post done\n",
      "pool 151 task 0 simulate done\n",
      "pool 151 task 1 simulate done\n",
      "pool 151 task 2 simulate done\n",
      "pool 151 task 3 simulate done\n",
      "pool 151 task 4 simulate done\n",
      "pool 151 task 5 simulate done\n",
      "pool 151 task 6 simulate done\n",
      "pool 151 task 7 simulate done\n",
      "pool 151 task 8 simulate done\n",
      "pool 151 task 9 simulate done\n",
      "pool 152 task 9 post done\n",
      "pool 152 task 0 simulate done\n",
      "pool 152 task 1 simulate done\n",
      "pool 152 task 2 simulate done\n",
      "pool 152 task 3 simulate done\n",
      "pool 152 task 4 simulate done\n",
      "pool 152 task 5 simulate done\n",
      "pool 152 task 6 simulate done\n",
      "pool 152 task 7 simulate done\n",
      "pool 152 task 8 simulate done\n",
      "pool 152 task 9 simulate done\n",
      "pool 153 task 9 post done\n",
      "pool 153 task 0 simulate done\n",
      "pool 153 task 1 simulate done\n",
      "pool 153 task 2 simulate done\n",
      "pool 153 task 3 simulate done\n",
      "pool 153 task 4 simulate done\n",
      "pool 153 task 5 simulate done\n",
      "pool 153 task 6 simulate done\n",
      "pool 153 task 7 simulate done\n",
      "pool 153 task 8 simulate done\n",
      "pool 153 task 9 simulate done\n",
      "pool 154 task 9 post done\n",
      "pool 154 task 0 simulate done\n",
      "pool 154 task 1 simulate done\n",
      "pool 154 task 2 simulate done\n",
      "pool 154 task 3 simulate done\n",
      "pool 154 task 4 simulate done\n",
      "pool 154 task 5 simulate done\n",
      "pool 154 task 6 simulate done\n",
      "pool 154 task 7 simulate done\n",
      "pool 154 task 8 simulate done\n",
      "pool 154 task 9 simulate done\n",
      "pool 155 task 9 post done\n",
      "pool 155 task 0 simulate done\n",
      "pool 155 task 1 simulate done\n",
      "pool 155 task 2 simulate done\n",
      "pool 155 task 3 simulate done\n",
      "pool 155 task 4 simulate done\n",
      "pool 155 task 5 simulate done\n",
      "pool 155 task 6 simulate done\n",
      "pool 155 task 7 simulate done\n",
      "pool 155 task 8 simulate done\n",
      "pool 155 task 9 simulate done\n",
      "pool 156 task 9 post done\n",
      "pool 156 task 0 simulate done\n",
      "pool 156 task 1 simulate done\n",
      "pool 156 task 2 simulate done\n",
      "pool 156 task 3 simulate done\n",
      "pool 156 task 4 simulate done\n",
      "pool 156 task 5 simulate done\n",
      "pool 156 task 6 simulate done\n",
      "pool 156 task 7 simulate done\n",
      "pool 156 task 8 simulate done\n",
      "pool 156 task 9 simulate done\n",
      "pool 157 task 9 post done\n",
      "pool 157 task 0 simulate done\n",
      "pool 157 task 1 simulate done\n",
      "pool 157 task 2 simulate done\n",
      "pool 157 task 3 simulate done\n",
      "pool 157 task 4 simulate done\n",
      "pool 157 task 5 simulate done\n",
      "pool 157 task 6 simulate done\n",
      "pool 157 task 7 simulate done\n",
      "pool 157 task 8 simulate done\n",
      "pool 157 task 9 simulate done\n",
      "pool 158 task 9 post done\n",
      "pool 158 task 0 simulate done\n",
      "pool 158 task 1 simulate done\n",
      "pool 158 task 2 simulate done\n",
      "pool 158 task 3 simulate done\n",
      "pool 158 task 4 simulate done\n",
      "pool 158 task 5 simulate done\n",
      "pool 158 task 6 simulate done\n",
      "pool 158 task 7 simulate done\n",
      "pool 158 task 8 simulate done\n",
      "pool 158 task 9 simulate done\n",
      "pool 159 task 9 post done\n",
      "pool 159 task 0 simulate done\n",
      "pool 159 task 1 simulate done\n",
      "pool 159 task 2 simulate done\n",
      "pool 159 task 3 simulate done\n",
      "pool 159 task 4 simulate done\n",
      "pool 159 task 5 simulate done\n",
      "pool 159 task 6 simulate done\n",
      "pool 159 task 7 simulate done\n",
      "pool 159 task 8 simulate done\n",
      "pool 159 task 9 simulate done\n",
      "pool 160 task 9 post done\n",
      "pool 160 task 0 simulate done\n",
      "pool 160 task 1 simulate done\n",
      "pool 160 task 2 simulate done\n",
      "pool 160 task 3 simulate done\n",
      "pool 160 task 4 simulate done\n",
      "pool 160 task 5 simulate done\n",
      "pool 160 task 6 simulate done\n",
      "pool 160 task 7 simulate done\n",
      "pool 160 task 8 simulate done\n",
      "pool 160 task 9 simulate done\n",
      "pool 161 task 9 post done\n",
      "pool 161 task 0 simulate done\n",
      "pool 161 task 1 simulate done\n",
      "pool 161 task 2 simulate done\n",
      "pool 161 task 3 simulate done\n",
      "pool 161 task 4 simulate done\n",
      "pool 161 task 5 simulate done\n",
      "pool 161 task 6 simulate done\n",
      "pool 161 task 7 simulate done\n",
      "pool 161 task 8 simulate done\n",
      "pool 161 task 9 simulate done\n",
      "pool 162 task 9 post done\n",
      "pool 162 task 0 simulate done\n",
      "pool 162 task 1 simulate done\n",
      "pool 162 task 2 simulate done\n",
      "pool 162 task 3 simulate done\n",
      "pool 162 task 4 simulate done\n",
      "pool 162 task 5 simulate done\n",
      "pool 162 task 6 simulate done\n",
      "pool 162 task 7 simulate done\n",
      "pool 162 task 8 simulate done\n",
      "pool 162 task 9 simulate done\n",
      "pool 163 task 9 post done\n",
      "pool 163 task 0 simulate done\n",
      "pool 163 task 1 simulate done\n",
      "pool 163 task 2 simulate done\n",
      "pool 163 task 3 simulate done\n",
      "pool 163 task 4 simulate done\n",
      "pool 163 task 5 simulate done\n",
      "pool 163 task 6 simulate done\n",
      "pool 163 task 7 simulate done\n",
      "pool 163 task 8 simulate done\n",
      "pool 163 task 9 simulate done\n",
      "pool 164 task 9 post done\n",
      "pool 164 task 0 simulate done\n",
      "pool 164 task 1 simulate done\n",
      "pool 164 task 2 simulate done\n",
      "pool 164 task 3 simulate done\n",
      "pool 164 task 4 simulate done\n",
      "pool 164 task 5 simulate done\n",
      "pool 164 task 6 simulate done\n",
      "pool 164 task 7 simulate done\n",
      "pool 164 task 8 simulate done\n",
      "pool 164 task 9 simulate done\n",
      "pool 165 task 9 post done\n",
      "pool 165 task 0 simulate done\n",
      "pool 165 task 1 simulate done\n",
      "pool 165 task 2 simulate done\n",
      "pool 165 task 3 simulate done\n",
      "pool 165 task 4 simulate done\n",
      "pool 165 task 5 simulate done\n",
      "pool 165 task 6 simulate done\n",
      "pool 165 task 7 simulate done\n",
      "pool 165 task 8 simulate done\n",
      "pool 165 task 9 simulate done\n",
      "pool 166 task 9 post done\n",
      "pool 166 task 0 simulate done\n",
      "pool 166 task 1 simulate done\n",
      "pool 166 task 2 simulate done\n",
      "pool 166 task 3 simulate done\n",
      "pool 166 task 4 simulate done\n",
      "pool 166 task 5 simulate done\n",
      "pool 166 task 6 simulate done\n",
      "pool 166 task 7 simulate done\n",
      "pool 166 task 8 simulate done\n",
      "pool 166 task 9 simulate done\n",
      "pool 167 task 9 post done\n",
      "pool 167 task 0 simulate done\n",
      "pool 167 task 1 simulate done\n",
      "pool 167 task 2 simulate done\n",
      "pool 167 task 3 simulate done\n",
      "pool 167 task 4 simulate done\n",
      "pool 167 task 5 simulate done\n",
      "pool 167 task 6 simulate done\n",
      "pool 167 task 7 simulate done\n",
      "pool 167 task 8 simulate done\n",
      "pool 167 task 9 simulate done\n",
      "pool 168 task 9 post done\n",
      "pool 168 task 0 simulate done\n",
      "pool 168 task 1 simulate done\n",
      "pool 168 task 2 simulate done\n",
      "pool 168 task 3 simulate done\n",
      "pool 168 task 4 simulate done\n",
      "pool 168 task 5 simulate done\n",
      "pool 168 task 6 simulate done\n",
      "pool 168 task 7 simulate done\n",
      "pool 168 task 8 simulate done\n",
      "pool 168 task 9 simulate done\n",
      "pool 169 task 9 post done\n",
      "pool 169 task 0 simulate done\n",
      "pool 169 task 1 simulate done\n",
      "pool 169 task 2 simulate done\n",
      "pool 169 task 3 simulate done\n",
      "pool 169 task 4 simulate done\n",
      "pool 169 task 5 simulate done\n",
      "pool 169 task 6 simulate done\n",
      "pool 169 task 7 simulate done\n",
      "pool 169 task 8 simulate done\n",
      "pool 169 task 9 simulate done\n",
      "pool 170 task 9 post done\n",
      "pool 170 task 0 simulate done\n",
      "pool 170 task 1 simulate done\n",
      "pool 170 task 2 simulate done\n",
      "pool 170 task 3 simulate done\n",
      "pool 170 task 4 simulate done\n",
      "pool 170 task 5 simulate done\n",
      "pool 170 task 6 simulate done\n",
      "pool 170 task 7 simulate done\n",
      "pool 170 task 8 simulate done\n",
      "pool 170 task 9 simulate done\n",
      "pool 171 task 9 post done\n",
      "pool 171 task 0 simulate done\n",
      "pool 171 task 1 simulate done\n",
      "pool 171 task 2 simulate done\n",
      "pool 171 task 3 simulate done\n",
      "pool 171 task 4 simulate done\n",
      "pool 171 task 5 simulate done\n",
      "pool 171 task 6 simulate done\n",
      "pool 171 task 7 simulate done\n",
      "pool 171 task 8 simulate done\n",
      "pool 171 task 9 simulate done\n",
      "pool 172 task 9 post done\n",
      "pool 172 task 0 simulate done\n",
      "pool 172 task 1 simulate done\n",
      "pool 172 task 2 simulate done\n",
      "pool 172 task 3 simulate done\n",
      "pool 172 task 4 simulate done\n",
      "pool 172 task 5 simulate done\n",
      "pool 172 task 6 simulate done\n",
      "pool 172 task 7 simulate done\n",
      "pool 172 task 8 simulate done\n",
      "pool 172 task 9 simulate done\n",
      "pool 173 task 9 post done\n",
      "pool 173 task 0 simulate done\n",
      "pool 173 task 1 simulate done\n",
      "pool 173 task 2 simulate done\n",
      "pool 173 task 3 simulate done\n",
      "pool 173 task 4 simulate done\n",
      "pool 173 task 5 simulate done\n",
      "pool 173 task 6 simulate done\n",
      "pool 173 task 7 simulate done\n",
      "pool 173 task 8 simulate done\n",
      "pool 173 task 9 simulate done\n",
      "pool 174 task 9 post done\n",
      "pool 174 task 0 simulate done\n",
      "pool 174 task 1 simulate done\n",
      "pool 174 task 2 simulate done\n",
      "pool 174 task 3 simulate done\n",
      "pool 174 task 4 simulate done\n",
      "pool 174 task 5 simulate done\n",
      "pool 174 task 6 simulate done\n",
      "pool 174 task 7 simulate done\n",
      "pool 174 task 8 simulate done\n",
      "pool 174 task 9 simulate done\n",
      "pool 175 task 9 post done\n",
      "pool 175 task 0 simulate done\n",
      "pool 175 task 1 simulate done\n",
      "pool 175 task 2 simulate done\n",
      "pool 175 task 3 simulate done\n",
      "pool 175 task 4 simulate done\n",
      "pool 175 task 5 simulate done\n",
      "pool 175 task 6 simulate done\n",
      "pool 175 task 7 simulate done\n",
      "pool 175 task 8 simulate done\n",
      "pool 175 task 9 simulate done\n",
      "pool 176 task 9 post done\n",
      "pool 176 task 0 simulate done\n",
      "pool 176 task 1 simulate done\n",
      "pool 176 task 2 simulate done\n",
      "pool 176 task 3 simulate done\n",
      "pool 176 task 4 simulate done\n",
      "pool 176 task 5 simulate done\n",
      "pool 176 task 6 simulate done\n",
      "pool 176 task 7 simulate done\n",
      "pool 176 task 8 simulate done\n",
      "pool 176 task 9 simulate done\n",
      "pool 177 task 9 post done\n",
      "pool 177 task 0 simulate done\n",
      "pool 177 task 1 simulate done\n",
      "pool 177 task 2 simulate done\n",
      "pool 177 task 3 simulate done\n",
      "pool 177 task 4 simulate done\n",
      "pool 177 task 5 simulate done\n",
      "pool 177 task 6 simulate done\n",
      "pool 177 task 7 simulate done\n",
      "pool 177 task 8 simulate done\n",
      "pool 177 task 9 simulate done\n",
      "pool 178 task 9 post done\n",
      "pool 178 task 0 simulate done\n",
      "pool 178 task 1 simulate done\n",
      "pool 178 task 2 simulate done\n",
      "pool 178 task 3 simulate done\n",
      "pool 178 task 4 simulate done\n",
      "pool 178 task 5 simulate done\n",
      "pool 178 task 6 simulate done\n",
      "pool 178 task 7 simulate done\n",
      "pool 178 task 8 simulate done\n",
      "pool 178 task 9 simulate done\n",
      "pool 179 task 9 post done\n",
      "pool 179 task 0 simulate done\n",
      "pool 179 task 1 simulate done\n",
      "pool 179 task 2 simulate done\n",
      "pool 179 task 3 simulate done\n",
      "pool 179 task 4 simulate done\n",
      "pool 179 task 5 simulate done\n",
      "pool 179 task 6 simulate done\n",
      "pool 179 task 7 simulate done\n",
      "pool 179 task 8 simulate done\n",
      "pool 179 task 9 simulate done\n",
      "pool 180 task 9 post done\n",
      "pool 180 task 0 simulate done\n",
      "pool 180 task 1 simulate done\n",
      "pool 180 task 2 simulate done\n",
      "pool 180 task 3 simulate done\n",
      "pool 180 task 4 simulate done\n",
      "pool 180 task 5 simulate done\n",
      "pool 180 task 6 simulate done\n",
      "pool 180 task 7 simulate done\n",
      "pool 180 task 8 simulate done\n",
      "pool 180 task 9 simulate done\n",
      "pool 181 task 9 post done\n",
      "pool 181 task 0 simulate done\n",
      "pool 181 task 1 simulate done\n",
      "pool 181 task 2 simulate done\n",
      "pool 181 task 3 simulate done\n",
      "pool 181 task 4 simulate done\n",
      "pool 181 task 5 simulate done\n",
      "pool 181 task 6 simulate done\n",
      "pool 181 task 7 simulate done\n",
      "pool 181 task 8 simulate done\n",
      "pool 181 task 9 simulate done\n",
      "pool 182 task 9 post done\n",
      "pool 182 task 0 simulate done\n",
      "pool 182 task 1 simulate done\n",
      "pool 182 task 2 simulate done\n",
      "pool 182 task 3 simulate done\n",
      "pool 182 task 4 simulate done\n",
      "pool 182 task 5 simulate done\n",
      "pool 182 task 6 simulate done\n",
      "pool 182 task 7 simulate done\n",
      "pool 182 task 8 simulate done\n",
      "pool 182 task 9 simulate done\n",
      "pool 183 task 9 post done\n",
      "pool 183 task 0 simulate done\n",
      "pool 183 task 1 simulate done\n",
      "pool 183 task 2 simulate done\n",
      "pool 183 task 3 simulate done\n",
      "pool 183 task 4 simulate done\n",
      "pool 183 task 5 simulate done\n",
      "pool 183 task 6 simulate done\n",
      "pool 183 task 7 simulate done\n",
      "pool 183 task 8 simulate done\n",
      "pool 183 task 9 simulate done\n",
      "pool 184 task 9 post done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/1dHPE1cID4ng8Dn1bA40jFzW\n",
      "other\n",
      "pool 184 task 0 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/Fi7JR92Y4Lr8IubBGyEyjv\n",
      "other\n",
      "pool 184 task 1 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/XPh9C4XM4jK9YZevss7pfH\n",
      "other\n",
      "pool 184 task 2 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/G9frx9735foch0jROeFYCC\n",
      "other\n",
      "pool 184 task 3 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/1KjsGj1e24KC99fCIUVF1DQ\n",
      "other\n",
      "pool 184 task 4 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/23vPnrcuP4kfbxwDSPFiWXT\n",
      "other\n",
      "pool 184 task 5 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/2ssAnC55x5fAc2cBURTqYcG\n",
      "other\n",
      "pool 184 task 6 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/3OSQNq6es4sD96r11oKQ6zXI\n",
      "other\n",
      "pool 184 task 7 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/dsMFFbs84S69fBZxpmf0H2\n",
      "other\n",
      "pool 184 task 8 simulate done\n",
      "Not complete : https://api.worldquantbrain.com/simulations/3KTD3Kegb4hrael7T5MkZIX\n",
      "other\n",
      "pool 184 task 9 simulate done\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "loc key error\n",
      "b'{\"user\":{\"id\":\"JW80368\"},\"token\":{\"expiry\":14400.0},\"permissions\":[\"CONSULTANT\",\"MULTI_SIMULATION\",\"PROD_ALPHAS\",\"REFERRAL\",\"SUPER_ALPHA\",\"VISUALIZATION\",\"WORKDAY\"]}'\n",
      "pool 185 task 9 post done\n",
      "pool 185 task 0 simulate done\n",
      "pool 185 task 1 simulate done\n",
      "pool 185 task 2 simulate done\n",
      "pool 186 task 9 post done\n",
      "pool 186 task 0 simulate done\n",
      "pool 186 task 1 simulate done\n",
      "pool 186 task 2 simulate done\n",
      "pool 186 task 3 simulate done\n",
      "pool 186 task 4 simulate done\n",
      "pool 186 task 5 simulate done\n",
      "pool 186 task 6 simulate done\n",
      "pool 186 task 7 simulate done\n",
      "pool 186 task 8 simulate done\n",
      "pool 186 task 9 simulate done\n",
      "pool 187 task 9 post done\n",
      "pool 187 task 0 simulate done\n",
      "pool 187 task 1 simulate done\n",
      "pool 187 task 2 simulate done\n",
      "pool 187 task 3 simulate done\n",
      "pool 187 task 4 simulate done\n",
      "pool 187 task 5 simulate done\n",
      "pool 187 task 6 simulate done\n",
      "pool 187 task 7 simulate done\n",
      "pool 187 task 8 simulate done\n",
      "pool 187 task 9 simulate done\n",
      "pool 188 task 9 post done\n",
      "pool 188 task 0 simulate done\n",
      "pool 188 task 1 simulate done\n",
      "pool 188 task 2 simulate done\n",
      "pool 188 task 3 simulate done\n",
      "pool 188 task 4 simulate done\n",
      "pool 188 task 5 simulate done\n",
      "pool 188 task 6 simulate done\n",
      "pool 188 task 7 simulate done\n",
      "pool 188 task 8 simulate done\n",
      "pool 188 task 9 simulate done\n",
      "pool 189 task 9 post done\n",
      "pool 189 task 0 simulate done\n",
      "pool 189 task 1 simulate done\n",
      "pool 189 task 2 simulate done\n",
      "pool 189 task 3 simulate done\n",
      "pool 189 task 4 simulate done\n",
      "pool 189 task 5 simulate done\n",
      "pool 189 task 6 simulate done\n",
      "pool 189 task 7 simulate done\n",
      "pool 189 task 8 simulate done\n",
      "pool 189 task 9 simulate done\n",
      "pool 190 task 9 post done\n",
      "pool 190 task 0 simulate done\n",
      "pool 190 task 1 simulate done\n",
      "pool 190 task 2 simulate done\n",
      "pool 190 task 3 simulate done\n",
      "pool 190 task 4 simulate done\n",
      "pool 190 task 5 simulate done\n",
      "pool 190 task 6 simulate done\n",
      "pool 190 task 7 simulate done\n",
      "pool 190 task 8 simulate done\n",
      "pool 190 task 9 simulate done\n",
      "pool 191 task 9 post done\n",
      "pool 191 task 0 simulate done\n",
      "pool 191 task 1 simulate done\n",
      "pool 191 task 2 simulate done\n",
      "pool 191 task 3 simulate done\n",
      "pool 191 task 4 simulate done\n",
      "pool 191 task 5 simulate done\n",
      "pool 191 task 6 simulate done\n",
      "pool 191 task 7 simulate done\n",
      "pool 191 task 8 simulate done\n",
      "pool 191 task 9 simulate done\n",
      "pool 192 task 9 post done\n",
      "pool 192 task 0 simulate done\n",
      "pool 192 task 1 simulate done\n",
      "pool 192 task 2 simulate done\n",
      "pool 192 task 3 simulate done\n",
      "pool 192 task 4 simulate done\n",
      "pool 192 task 5 simulate done\n",
      "pool 192 task 6 simulate done\n",
      "pool 192 task 7 simulate done\n",
      "pool 192 task 8 simulate done\n",
      "pool 192 task 9 simulate done\n",
      "pool 193 task 9 post done\n",
      "pool 193 task 0 simulate done\n",
      "pool 193 task 1 simulate done\n",
      "pool 193 task 2 simulate done\n",
      "pool 193 task 3 simulate done\n",
      "pool 193 task 4 simulate done\n",
      "pool 193 task 5 simulate done\n",
      "pool 193 task 6 simulate done\n",
      "pool 193 task 7 simulate done\n",
      "pool 193 task 8 simulate done\n",
      "pool 193 task 9 simulate done\n",
      "pool 194 task 9 post done\n",
      "pool 194 task 0 simulate done\n",
      "pool 194 task 1 simulate done\n",
      "pool 194 task 2 simulate done\n",
      "pool 194 task 3 simulate done\n",
      "pool 194 task 4 simulate done\n",
      "pool 194 task 5 simulate done\n",
      "pool 194 task 6 simulate done\n",
      "pool 194 task 7 simulate done\n",
      "pool 194 task 8 simulate done\n",
      "pool 194 task 9 simulate done\n",
      "pool 195 task 9 post done\n",
      "pool 195 task 0 simulate done\n",
      "pool 195 task 1 simulate done\n",
      "pool 195 task 2 simulate done\n",
      "pool 195 task 3 simulate done\n",
      "pool 195 task 4 simulate done\n",
      "pool 195 task 5 simulate done\n",
      "pool 195 task 6 simulate done\n",
      "pool 195 task 7 simulate done\n",
      "pool 195 task 8 simulate done\n",
      "pool 195 task 9 simulate done\n",
      "pool 196 task 9 post done\n",
      "pool 196 task 0 simulate done\n",
      "pool 196 task 1 simulate done\n",
      "pool 196 task 2 simulate done\n",
      "pool 196 task 3 simulate done\n",
      "pool 196 task 4 simulate done\n",
      "pool 196 task 5 simulate done\n",
      "pool 196 task 6 simulate done\n",
      "pool 196 task 7 simulate done\n",
      "pool 196 task 8 simulate done\n",
      "pool 196 task 9 simulate done\n",
      "pool 197 task 9 post done\n",
      "pool 197 task 0 simulate done\n",
      "pool 197 task 1 simulate done\n",
      "pool 197 task 2 simulate done\n",
      "pool 197 task 3 simulate done\n",
      "pool 197 task 4 simulate done\n",
      "pool 197 task 5 simulate done\n",
      "pool 197 task 6 simulate done\n",
      "pool 197 task 7 simulate done\n",
      "pool 197 task 8 simulate done\n",
      "pool 197 task 9 simulate done\n",
      "pool 198 task 9 post done\n",
      "pool 198 task 0 simulate done\n",
      "pool 198 task 1 simulate done\n",
      "pool 198 task 2 simulate done\n",
      "pool 198 task 3 simulate done\n",
      "pool 198 task 4 simulate done\n",
      "pool 198 task 5 simulate done\n",
      "pool 198 task 6 simulate done\n",
      "pool 198 task 7 simulate done\n",
      "pool 198 task 8 simulate done\n",
      "pool 198 task 9 simulate done\n",
      "pool 199 task 9 post done\n",
      "pool 199 task 0 simulate done\n",
      "pool 199 task 1 simulate done\n",
      "pool 199 task 2 simulate done\n",
      "pool 199 task 3 simulate done\n",
      "pool 199 task 4 simulate done\n",
      "pool 199 task 5 simulate done\n",
      "pool 199 task 6 simulate done\n",
      "pool 199 task 7 simulate done\n",
      "pool 199 task 8 simulate done\n",
      "pool 199 task 9 simulate done\n",
      "pool 200 task 9 post done\n",
      "pool 200 task 0 simulate done\n",
      "pool 200 task 1 simulate done\n",
      "pool 200 task 2 simulate done\n",
      "pool 200 task 3 simulate done\n",
      "pool 200 task 4 simulate done\n",
      "pool 200 task 5 simulate done\n",
      "pool 200 task 6 simulate done\n",
      "pool 200 task 7 simulate done\n",
      "pool 200 task 8 simulate done\n",
      "pool 200 task 9 simulate done\n",
      "pool 201 task 9 post done\n",
      "pool 201 task 0 simulate done\n",
      "pool 201 task 1 simulate done\n",
      "pool 201 task 2 simulate done\n",
      "pool 201 task 3 simulate done\n",
      "pool 201 task 4 simulate done\n",
      "pool 201 task 5 simulate done\n",
      "pool 201 task 6 simulate done\n",
      "pool 201 task 7 simulate done\n",
      "pool 201 task 8 simulate done\n",
      "pool 201 task 9 simulate done\n",
      "pool 202 task 9 post done\n",
      "pool 202 task 0 simulate done\n",
      "pool 202 task 1 simulate done\n",
      "pool 202 task 2 simulate done\n",
      "pool 202 task 3 simulate done\n",
      "pool 202 task 4 simulate done\n",
      "pool 202 task 5 simulate done\n",
      "pool 202 task 6 simulate done\n",
      "pool 202 task 7 simulate done\n",
      "pool 202 task 8 simulate done\n",
      "pool 202 task 9 simulate done\n",
      "pool 203 task 9 post done\n",
      "pool 203 task 0 simulate done\n",
      "pool 203 task 1 simulate done\n",
      "pool 203 task 2 simulate done\n",
      "pool 203 task 3 simulate done\n",
      "pool 203 task 4 simulate done\n",
      "pool 203 task 5 simulate done\n",
      "pool 203 task 6 simulate done\n",
      "pool 203 task 7 simulate done\n",
      "pool 203 task 8 simulate done\n",
      "pool 203 task 9 simulate done\n",
      "pool 204 task 9 post done\n",
      "pool 204 task 0 simulate done\n",
      "pool 204 task 1 simulate done\n",
      "pool 204 task 2 simulate done\n",
      "pool 204 task 3 simulate done\n",
      "pool 204 task 4 simulate done\n",
      "pool 204 task 5 simulate done\n",
      "pool 204 task 6 simulate done\n",
      "pool 204 task 7 simulate done\n",
      "pool 204 task 8 simulate done\n",
      "pool 204 task 9 simulate done\n",
      "pool 205 task 9 post done\n",
      "pool 205 task 0 simulate done\n",
      "pool 205 task 1 simulate done\n",
      "pool 205 task 2 simulate done\n",
      "pool 205 task 3 simulate done\n",
      "pool 205 task 4 simulate done\n",
      "pool 205 task 5 simulate done\n",
      "pool 205 task 6 simulate done\n",
      "pool 205 task 7 simulate done\n",
      "pool 205 task 8 simulate done\n",
      "pool 205 task 9 simulate done\n",
      "pool 206 task 9 post done\n",
      "pool 206 task 0 simulate done\n",
      "pool 206 task 1 simulate done\n",
      "pool 206 task 2 simulate done\n",
      "other\n",
      "pool 206 task 3 simulate done\n"
     ]
    }
   ],
   "source": [
    "# Simulate First Order\n",
    "multi_simulate(pools, \"SUBINDUSTRY\", \"AMR\", \"TOP600\", 207, 300, \"amr_fo_fund65_sub\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = get_datafields(s, dataset_id='news85', region='USA', universe='TOP3000', delay=1)\n",
    "print(df[df['type'] == \"VECTOR\"][\"id\"].tolist())\n",
    "print(process_datafields(df, \"vector\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
